package enumdemo;

import util.Print;

import java.util.EnumSet;

public class EnumSetDemo {

	public static void main(String[] args) {
		EnumSet<AlarmPoints> points = EnumSet.noneOf(AlarmPoints.class);
		points.add(AlarmPoints.STAIR1);
		Print.print(points);
		points.addAll(EnumSet.of(AlarmPoints.OFFICE1, AlarmPoints.STAIR2));
		Print.print(points);
		points = EnumSet.allOf(AlarmPoints.class);
		Print.print(points);
		points.removeAll(EnumSet.of(AlarmPoints.OFFICE1, AlarmPoints.STAIR2));
		Print.print(points);
		points.removeAll(EnumSet.range(AlarmPoints.OFFICE1, AlarmPoints.OFFICE4));
		Print.print(points);
		points=EnumSet.complementOf(points);
		Print.print(points);
	}
}

enum AlarmPoints {
	STAIR1,STAIR2,LOBBY,OFFICE1,OFFICE2,
	OFFICE3,OFFICE4,BATHROOM,UTILITY,KITCHEN
}